/** 出现异步问题的案例 */
import type { App } from "vue";


const getComponents = () => {
    const components = import.meta.glob("./*/index.vue");
    return Object.values(components);
}

const install = (app: App) => {
    const componentList = getComponents();

    componentList.forEach(async (element: any) => {
        const { default: component } = await element();
        console.log(component)
        if (component.name) {
            app.component(component.name, component);
        }
    });
}


export default { install }
